package com.three.controller;

import com.three.aop.LogAnotation;
import com.three.service.StafftransferService;
import com.three.vo.R;
import com.three.vo.StaffExListVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/stafftransfer")
public class StafftransferController {
    @Autowired
    private StafftransferService stafftransferService;
    //查询所有员工调动记录
    @PostMapping("/getAll")
    public R getAll(Integer currentPage, Integer pageSize,@RequestBody StaffExListVo staffExListVo){
        return stafftransferService.getAll(currentPage,pageSize, staffExListVo);
    }
    //通过审核
    @PostMapping("/updateStateYes")
    @LogAnotation("通过调动申请")//日志
    public R updateStateYes(Integer id,Integer newbranchid,Integer newdeptid,Integer staffid,Integer deptid){
        return stafftransferService.updateStateYes(id,newbranchid,newdeptid,staffid,deptid);
    }
    //驳回审核
    @PostMapping("/updateStateNo")
    @LogAnotation("驳回调动申请")//日志
    public R updateStateNo(Integer id){
        return stafftransferService.updateStateNo(id);
    }
}
